package structuralPatterns.flyweight;

public class Main {
    public static void main(String[] args){

        FlyweightFactory factory = new FlyweightFactory();
        Flyweight f1 = factory.getFlyweight("flyweight 1");
        Flyweight f2 = factory.getFlyweight("flyweight 2");
        Flyweight f3 = factory.getFlyweight("flyweight 1");

        f1.operation();
        f2.operation();
        f3.operation();

        System.out.println("flyweight size is:"+factory.getFlyweightSize());
        System.out.println("f1 equals to f3:"+f1.equals(f3));
    }
}
